<div class="MainContent">	
{literal}
	<script>
		function checkEmail() {
			var email = document.add_form.email;
			var filter = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
			if(email.value.trim().length == 0){
				alert('Please, enter your E-Mail address!');
				email.focus();
				email.select();
				return false;
			}else if (!filter.test(email.value)) {
				alert('Please provide a valid email address');
				email.focus();
				email.select();
				return false;
			}
			return true;
		}
		function validate(){
		  var d = document.add_form;
		  if (!d.name.value) {
		    alert('Please enter your Site Name.');
		    d.name.focus();
		    return false;
		  }
		  if (!d.url.value){
		    alert('Please enter your Site URL.');
		    d.url.focus();
		    return false;
		  }
		  if(!checkEmail()){
			  return false;
		  }
		 //edit by chiang
		 var tempd = d.name.value.toLowerCase();
		  if (tempd.indexOf('<script')>0 || tempd.indexOf('<iframe')>0){
		  	 alert('Valid Site Name!');
			 d.name.focus();
			 d.name.select();
			 return false;
		  }
		  
		 tempd = d.url.value.toLowerCase();
		 if (tempd.indexOf('<script')>0 || tempd.indexOf('<iframe')>0){
		  	 alert('Valid Site URL!');
			 d.url.focus();
			 d.url.select();
			 return false;
		 }
		  
		 tempd = d.percents.value.toLowerCase();  
		 if (tempd.indexOf('<script')>0 || tempd.indexOf('<iframe')>0){
		  	 alert('Valid percents!');
			 d.percents.focus();
			 d.percents.select();
			 return false;
		 }
		  
		 tempd = d.min_spend.value.toLowerCase(); 
		 if (tempd.indexOf('<script')>0 || tempd.indexOf('<iframe')>0){
		  	 alert('Valid min_spend!');
			 d.min_spend.focus();
			 d.min_spend.select();
			 return false;
		  }
		  
		  tempd = d.max_spend.value.toLowerCase(); 
		  if (tempd.indexOf('<script')>0 || tempd.indexOf('<iframe')>0){
		  	 alert('Valid max_spend!');
			 d.max_spend.focus();
			 d.max_spend.select();
			 return false;
		  }
		
		  tempd = d.referral.value.toLowerCase();
		  if (tempd.indexOf('<script')>0 || tempd.indexOf('<iframe')>0){
		  	 alert('Valid referral!');
			 d.referral.focus();
			 d.referral.select();
			 return false;
		  }
		
		  tempd = d.description.value.toLowerCase();
		  if (tempd.indexOf('<script')>0 || tempd.indexOf('<iframe')>0){
		  	 alert('Valid description!');
			 d.description.focus();
			 d.description.select();
			 return false;
		  }
		  
		  //edit by chiang
		  return true;
		}
	</script>
{/literal}
<form method="post" name="add_form" onsubmit="return validate()">
<input type="hidden" name="aAction" value="add">
<div class="box1 Box1Style2"><span class="Box1Text">Add listing</span></div>
<div class="box2">
			{if $errors}
				{section name=e loop=$errors}
					&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red">- {$errors[e].name}<br></span>
				{/section}
			{/if}
				<br>			
				<b> After entering and submitting the form below. Your program will be added to our listing after we confirmed </b>
				<br>
				<br>
			<table cellspacing="1" cellpadding="2" border="0" width="90%" align="center" >
				<tr align=left>
		 			<th>Site Name:</th>
		 			<td>
		 				<input type="text" name="name" value="{$frm.name|escape:html}" class=inpts_add size=50>
		 				<span class="req_feild">*</span>
		 			</td>
				</tr>
				<tr align=left>
		 			<th>Site URL:</th>
		 			<td>
		 				<input type="text" name="url" value="{$frm.url|escape:html}" class=inpts_add size=50>
		 				<span class="req_feild">*</span>
		 			</td>
				</tr>
				<tr align=left>
		 			<th>Contact E-mail:</th>
		 			<td>
		 				<input type="text" name="email"   value="{$email}" class=inpts_add size=50>
		 				<span class="req_feild">*</span>
		 			</td>
				</tr>
				<tr align=left>
		 			<th>Interest Percents:</th>
		 			<td><input type="text" name="percents" value="{$frm.percents|escape:html}" class=inpts_add size=50></td>
				</tr>
				<tr align=left>
		 			<th>Minimal Spend:</th>
		 			<td><input type="text" name="min_spend" value="{$frm.min_spend|escape:html}" class=inpts_add size=50></td>
				</tr>
				<tr align=left>
		 			<th>Maximal Spend:</th>
		 			<td><input type="text" name="max_spend" value="{$frm.max_spend|escape:html}" class=inpts_add size=50></td>
				</tr>
				<tr align=left>
		 			<th>Referral Bonus:</th>
		 			<td><input type="text" name="referral" value="{$frm.referral|escape:html}" class=inpts_add size=50></td>
				</tr>
				<tr align=left>
		 			<th>Withdrawal Type:</th>
		 			<td>
					   <select name="withdrawal_type" class=inpts_add>
					     <option value=1 >Manual</option>
					     <option value=2 >Instant</option>
					     <option value=3 >Automatic</option>
					   </select> 
					</td>
				</tr>
				<tr align=left>
		 			<th>Support E-mail:</th>
		 			<td><input type="text" name="support_email" value="{$frm.support_email|escape:html}" class=inpts_add size=50></td>
				</tr>
				<tr align=left>
		 			<th>TG Support Forum:</th>
		 			<td><input type="text" name="support_form" value="{$frm.support_form|escape:html}" class=inpts_add size=50></td>
				</tr>
				<tr align=left>
		 			<th>MMG Support Forum:</th>
		 			<td><input type="text" name="support_forum" value="{$frm.support_forum|escape:html}" class=inpts_add size=50></td>
				</tr>
				<tr align=left>
		 			<th>DTM Support Forum:</th>
		 			<td><input type="text" name="support_aim" value="{$frm.support_aim|escape:html}" class=inpts_add size=50></td>
				</tr>
				<tr align=left>
		  			<th valign=top >Payment Methods:</th>
		  			<td>
						{section name=p loop=$payments}
						   <input type="checkbox" name="payments[{$payments[p].name}]" value=1>{$payments[p].name} 
						   <br>
						{/section}  
					</td>
				</tr>
				<tr align=left>
		  			<th>Description</th>
		  			<td>
			  			<textarea name="description" cols=80 rows=5 class=inpts  style="-moz-border-radius: 5px 5px 5px 5px;" >{$frm.description|escape:html}</textarea>
		  			</td>
				</tr>
				<tr align=left>
		  			<td colspan=2><span class="req_feild">*</span> Required fields</td>
				</tr>
				<tr align="center">
		  			<td colspan="2">
		  				<input  type="submit" class="sbmt" style="width: 150px;" value="Add My Program Now" />
		  			</td>
		  		</tr>
			</table>
</div>
</form>
</div>
